<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>评价</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/node_modules/LobsterUIFrame/weui/css/weui.css" />
    <link rel="stylesheet" href="/node_modules/LobsterUIFrame/weui/css/weuix.css" />
    <script src="/node_modules/LobsterUIFrame/weui/js/zepto.min.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/zepto.weui.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/swipe.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/macy.js"></script>
    <script src="/node_modules/LobsterUIFrame/weui/js/php.js"></script>
    <script src="/lobstersdk/lobster.js"></script>
    <script src="/jslib/template-web.js"></script>
    <style>

    </style>
</head>

<body ontouchstart class="page-bd-15">
    <div class="weui-panel__bd" id="evaluatelist">
        
    </div>
</body>

</html>

<script  type="text/template" id="evaluatetemp"> 
    {{each list item}}
    <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
            <div class="weui-media-box__hd">
                <img class="weui-media-box__thumb" src="{{item.SpecImg}}" alt="">
            </div>
            <div class="weui-media-box__bd">
                <h4 class="weui-media-box__title">{{item.GoodsName}}</h4>
                <p class="weui-media-box__desc">规格：{{item.SpecName}}</p> 
            </div>
        </a>
        <div style="display: flex;justify-content: flex-end;">
            <div>
                <a href="javascript:;" data-item="{{item}}" class="weui-btn weui-btn_mini weui-btn_primary bg-orange toevaluate"></i>评价</a>
            </div>
        </div>
    </a>
    {{/each}}
</script>

<script>

    lobsterh5.main({
        data: {
            evaluatelist: [],
            orderNo: ''
        },
        //初始化页面
        pageload: function () {
            var self = this;
            self.data.orderNo = lobsterh5.GetUrlParam("orderNo");
            self.initevent();
            self.getEvaluateListByOrderNo();

        },
        //初始化事件
        initevent: function () {
            var self = this;
            $("#evaluatelist").on("click",".toevaluate",function(){
                location.href="evaluate.html?goods="+JSON.stringify($(this).data("item"));
            })
        },
        getEvaluateListByOrderNo: function () {
            var self=this;
            lobsterh5.GET("/lowcode/APP20200616102057595/shop/?fun=mall.GetEvaluateListByOrderNo", {
                orderNo: self.data.orderNo
            }).then(res => {
                self.data.evaluatelist = res.list;
                var html = template("evaluatetemp", { list: self.data.evaluatelist });
                $("#evaluatelist").html(html);
            }).catch(res => {
                $.toast(res.msg, 'forbidden');
            })
        },
    })
</script>